from base.request_new import RequestNew
from config import SSO, STAG, sso_user, sso_pwd
from functools import lru_cache


@lru_cache(maxsize=1)
def user_login(retry=False):
    """
    SSO登录
    :return: 登录cookies
    """

    sso_login = {
        "url": f"{SSO}/",
        "data": {},
        "method": "GET",
        "content_type": "FORM",
    }

    rt = RequestNew()
    r = rt.request_auto(**sso_login)[0]
    res = ""
    return res
